package com.wgts.wgts.mvp.presenter.imp;

import com.wgts.wgts.mvp.model.IIdeaBackActivityModel;
import com.wgts.wgts.mvp.presenter.IIdeaBackActivityPresenter;
import com.wgts.wgts.mvp.view.IIdeaBackActivityView;
import com.wgts.wgts.netmodle.HttpResultSubscriber;
import com.wgts.wgts.netmodle.resp.IdeaBackEntity;

/*
 *
 *
 *   data:2018/10/1810:13
 *
 */public class IdeaBackActivityPresenter implements IIdeaBackActivityPresenter {
     private IIdeaBackActivityView view;
     private IIdeaBackActivityModel model;

    public IdeaBackActivityPresenter(IIdeaBackActivityView view, IIdeaBackActivityModel model) {
        this.view = view;
        this.model = model;
    }

    @Override
    public void upIdeaBack(String adviceUserPhone, String adviceContent, String adviceImages) {
        model.upIdeaBack(adviceUserPhone, adviceContent, adviceImages, new HttpResultSubscriber<IdeaBackEntity>() {
            @Override
            public void onSuccess(IdeaBackEntity ideaBackEntity) {
                view.upIdeaBack(ideaBackEntity);
            }

            @Override
            public void _onError(int status, String msg) {
                view.onError(status, msg);
            }
        });
    }
}
